package com.clay.singleton.type8;

/**
 * @Author : clay
 * @Description:
 * @Date: Create in 21:42 2021/3/14
 * @Modified By:
 */
public class singleton8 {
    public static void main(String[] args) {
        singleton instance = singleton.INSTANCE;
        singleton instance1 = singleton.INSTANCE;

        System.out.println(instance.hashCode());
        System.out.println(instance1.hashCode());
        instance.sayok();
    }
}

enum singleton
{
    INSTANCE;
    public void sayok()
    {
        System.out.println("ok");
    }
}
